home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 94 / CD-ROM 94.iso / util / weban / setup.msi / Cabs.w29.cab / reportdetailsSQL.xsl < prev   
Encoding:
Extensible Markup Language  |  2002-07-08  |  2.7 KB  |  71 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     
  4.     <xsl:variable name="CheckID" select="'CheckIDHere'"></xsl:variable>
  5.     <xsl:variable name="InstanceName" select="'InstanceNameHere'"></xsl:variable>
  6.  
  7.     <xsl:variable name="ScoreLookup">
  8.       <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  9.       <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  10.       <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  11.       <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  12.       <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  13.       <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  14.       <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  15.     </xsl:variable>
  16.     
  17.     <xsl:template match="SecScan">
  18.         <xsl:choose>
  19.         <xsl:when test='SQLInstance[@Name=$InstanceName]'>
  20.             <h1><xsl:value-of select="SQLInstance/Check[@ID=$CheckID]/Advice"/></h1>
  21.             <h2>Result Details for SQL Instance  <xsl:value-of select="$InstanceName"/> <br /><br /><xsl:value-of select="Check[@ID=$CheckID]/Detail/@text"/></h2>
  22.             <table id="TableID" width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #000000; padding-left: 10px; padding-right: 10px;">
  23.             <tr class="DetailHeader">
  24.                 <td>
  25.                     Score
  26.                 </td>
  27.                 <xsl:for-each select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Detail/Head/Col">
  28.                     <td Nowrap="true">
  29.                     <xsl:value-of select="."/>
  30.                     </td>
  31.                 </xsl:for-each>
  32.             </tr>
  33.             
  34.             <xsl:for-each select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Detail">
  35.                 <xsl:apply-templates select="Row">
  36.                 </xsl:apply-templates>
  37.             </xsl:for-each>
  38.             </table>
  39.         </xsl:when>
  40.         </xsl:choose>
  41.     </xsl:template>
  42.  
  43.     <xsl:template match="Row">
  44.     <xsl:param name="score" select="@Grade"/>
  45.         <tr>
  46.             <td valign="top">
  47.                 <xsl:choose>
  48.                   <xsl:when test="../../@ID='121'">
  49.                     <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  50.                   </xsl:when>
  51.                   <xsl:otherwise>
  52.                     <IMG alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />
  53.                   </xsl:otherwise>
  54.                 </xsl:choose>    
  55.             </td>
  56.             <xsl:for-each select="Col">
  57.             <td valign="top">
  58.              <xsl:choose>
  59.               <xsl:when test="@URL">
  60.                 <A target="blank" href="{@URL}"><xsl:value-of select="."/></A>
  61.               </xsl:when>
  62.               <xsl:otherwise>
  63.                 <xsl:value-of select="."/>
  64.               </xsl:otherwise>
  65.             </xsl:choose>    
  66.             </td>
  67.             </xsl:for-each>
  68.         </tr>
  69.     </xsl:template>
  70.     
  71. </xsl:stylesheet>